﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 系统权限表
/// </summary>
[Table("Sys_Permission")]
public partial class SysPermission
{
    /// <summary>
    /// 权限ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 权限名称
    /// </summary>
    [StringLength(255)]
    public string Name { get; set; } = null!;

    /// <summary>
    /// 父级权限ID（用于构建权限层级）
    /// </summary>
    [StringLength(32)]
    public string? ParentId { get; set; }

    /// <summary>
    /// 权限类型：1=菜单，2=操作，3=API
    /// </summary>
    public int Type { get; set; }

    /// <summary>
    /// API接口路径，仅API类型权限需要
    /// </summary>
    [StringLength(255)]
    public string? ApiPath { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }
}
